package com.useeinfo.oa.common.utils.exception.view;

import com.useeinfo.oa.common.exception.dto.ExceptionDto;
import com.useeinfo.oa.common.utils.exception.JudgmentView;
import org.springframework.http.HttpStatus;

/**
 * @author geniusj
 * @email 975473185@qq.com
 * @date 2018/8/20  下午3:02
 */
public class RuntimeJudgmentView implements JudgmentView{

    private final static String  RUNTIME_VIEW = "/error/500";

    private Exception exception;

    public RuntimeJudgmentView(RuntimeException exception) {
        this.exception = exception;
    }

    @Override
    public ExceptionDto getViewDetail() {
        return new ExceptionDto(exception, "服务器异常", HttpStatus.INTERNAL_SERVER_ERROR,RUNTIME_VIEW);
    }
}
